/**
 * Created by Administrator on 2025/5/7.
 * */
#ifndef AIPC_ERA
#define AIPC_ERA

#include "CudaModule.h"
#include "../GlobalParameters.h"
#include <mutex>
#include <thread>
#include <zmq.hpp>
#include <string>
#include "../include/zy_net.h"

extern "C" BaseObject *createAIPC();
extern "C" void destroyAIPC(BaseObject *p);

class AIPC : public CudaModule {
public:
AIPC();

~AIPC();

//void onPushCudaOperations(buffer_table_t *input, buffer_table_t *output, cudaStream_t stream) override;
void onIssueStreamedCudaOperations(buffer_table_t *input, buffer_table_t *output, cudaStream_t stream) override;
    void zmqRepServe();

private:
    zmq::context_t context;
    // 时间步订阅
    std::string topicAddr = "tcp://192.168.1.115:6001";
    std::string topicName = "MainController";
    zmq::socket_t sub;
    // AIPC通知通道
    zmq::socket_t rep_socket;
    std::string rep_address = "tcp://192.168.1.115:6006";
    int prevStep;
};

#endif //TASK2_ERA
